home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-21 / dgansi.zip / DGANSI.DOC < prev    next >
Text File  |  1992-03-01  |  30KB  |  684 lines

  1.      DgAnsi.Com
  2. Copyright By:
  3.     Don E. Groves, Jr.
  4.     2915 West Ox Rd.
  5.     Herndon, VA 22071
  6.  
  7.     CIS Number [71310,3702]
  8.  
  9. I.   Background
  10.  
  11.      When I first got DESQview, I noticed that none of my ANSI
  12. drivers would work properly with it, and the supplied DVANSI.COM
  13. required more memory than I was willing to sacrifice.
  14.  
  15.      DgAnsi is the result.  It requires less than 3.8 kilobytes
  16. of memory to load, and requires as little as 1 kilobyte in a
  17. DESQview window.  DgAnsi is a superset of the IBM PC
  18. implementation of the ANSI X3.64-1979 specification, implementing
  19. several extensions and enhancements to that specification.
  20.  
  21.      DgAnsi can be safely loaded in an Upper Memory Block, will
  22. not double load, and will not load if any other ANSI driver is
  23. loaded.  After loading it can be reconfigured, disabled, or
  24. uninstalled.  DgAnsi can be invoked with different parameters in
  25. different DESQview windows.
  26.  
  27.      A note of thanks should be given to:
  28.  
  29.      PC Magazine and Michael J. Mefford.  Providing and
  30. documenting the source code of ANSI.COM gave me a big
  31. "jump-start" in writing this program.
  32.  
  33.      Borland Turbo Assembler 2.50 and TLink.  DgAnsi is written
  34. in TASM ideal mode.
  35.  
  36.      Mike Bessy and Edward Phillips for putting up with some of
  37. my earlier versions.  Their willingness to try the next ones was
  38. a great encouragement to keep trying.
  39.  
  40. DgAnsi.Com, DgAnsi18.Com, DgAnsi.Shp, and DgAnsi.Doc were written
  41. by and are Copyright (c) 1990-91 by Don E. Groves, Jr.  All
  42. rights reserved.
  43.  
  44.  
  45. II.  Files Included In This Distribution Archive
  46.  
  47.      DgAnsi.Com   --  the basic DgAnsi program.  This version
  48.                       will run on any computer using PC- or
  49.                       MS-DOS 3.1 or above.
  50.  
  51.      DgAnsi18.Com --  optimized version of DgAnsi.Com using the
  52.                       80186 instruction set.  This version will
  53.                       run on any computer equipped with a
  54.                       V20/V30,, 80286 or higher cpu, and using
  55.                       PC- or MS-DOS 3.1 or above.  DgAnsi18.Com
  56.                       is slightly smaller and slightly faster
  57.                       than DgAnsi.Com.
  58.  
  59.                       In this document we shall refer only to the
  60.                       command "DgAnsi;" if you are using the
  61.                       186-optimized version make the appropriate
  62.                       substitution.  You may prefer to delete
  63.                       DgAnsi.Com and rename DgAnsi18.Com to
  64.                       DgAnsi.Com.
  65.  
  66.      DgAnsi.Shp   --  "DESQview-aware" shared program module for
  67.                       use in DESQview windows.  To use DgAnsi.Shp
  68.                       you must load DgAnsi.Com before DESQview.
  69.                       This enables DgAnsi.Shp to use the code of
  70.                       DgAnsi.Com, while maintaining its own data
  71.                       space in the DESQview window.
  72.  
  73.      DgAnsi.Doc   --  This documentation.
  74.  
  75.  
  76. III. Running DgAnsi.Com
  77.  
  78.      The syntax for loading or configuring DgAnsi is as follows:
  79.  
  80.           DgAnsi [commands] [/switches]
  81.  
  82.      Entering "DgAnsi" without commands or switches will load
  83. DgAnsi in its default configuration.
  84.  
  85.      The commands are:
  86.  
  87.      ? | /?    Displays the DgAnsi help screen.
  88.  
  89.      ON        By default, DgAnsi is loaded with all functions
  90.                enabled.  Use this command to reenable DgAnsi
  91.                after turning it off.
  92.  
  93.      OFF | OF  Temporarily disables DgAnsi functions.  DgAnsi OFF
  94.                leaves DgAnsi loaded in memory, and it may be
  95.                reenabled by issuing DgAnsi ON.
  96.  
  97.      FAST | FAS | FA | F+  Direct screen writing mode.  This is
  98.                the default.
  99.  
  100.      SLOW | SLO | SL | F-  Screen writes via the BIOS.  If you
  101.                are experiencing display problems, DgAnsi SLOW
  102.                should cure them.  This mode is noticeably slower
  103.                than the default screen writing method.
  104.  
  105.      K+        Enable keyboard reassignments.  This is the
  106.                default.
  107.  
  108.      K-        Disable keyboard reassignments.  Disabling
  109.                keyboard reassignments disables any key
  110.                reassignments previously made.
  111.  
  112.      P+        Enable new key reassignments.  This is the
  113.                default.
  114.             
  115.      P-        Disable new key reassignments.  Disabling further
  116.                key reassignments retains any key reassignments
  117.                previously made, while disabling additional
  118.                reassignments.
  119.  
  120.      Q+        Enable Extended Unique Keys on. This is the
  121.                default.  On enhanced keyboards, using DOS 4.0 or
  122.                above, the gray keys generate different scan codes
  123.                than their white key equivalents.
  124.  
  125.      Q-        Disable Extended Unique Keys on enhanced
  126.                keyboards.  Disabling unique keys will make the
  127.                gray keys on enhanced keyboards behave exactly as
  128.                their white key equivalents.
  129.  
  130.      The switches are:
  131.  
  132.      /@filename  Issue ANSI commands, at initial load or after,
  133.                contained in a file.  The entire command sequence
  134.                must be entered in the file, including the leading
  135.                ESCape [.
  136.  
  137.                The contents of the configuration file are typed
  138.                to standard output, and have the same effect as
  139.  
  140.                     TYPE filename
  141.  
  142.                Very little checking for a valid filename is done.
  143.                If the file is not found, the switch is ignored.
  144.  
  145.      /Bnnnn    Buffer size in bytes for key reassignments.  The
  146.                value for nnnn is from 0 to approximately 61000
  147.                bytes; the default is 200 bytes.  Specifying /b0
  148.                will save 192 bytes in the resident load size.
  149.  
  150.                This switch may be specified only when loading
  151.                DgAnsi; once a buffer size has been set it may not
  152.                be changed.
  153.  
  154.                Since DgAnsi.Shp establishes it own data area, you
  155.                may set different buffer sizes, using DgAnsi.Shp,
  156.                in each DESQview window.
  157.  
  158.                The buffer size may also be independently set for
  159.                any secondary shell copy of DgAnsi (/w).
  160.  
  161.      /C        Clear Reassignment Buffer.  This clears all key
  162.                reassignments.
  163.  
  164.      /D<color>m  Set display colors from command line.  The color
  165.                specification is a standard ANSI sequence (see
  166.                below).  For example,
  167.  
  168.                     dgansi /d0;1;33;40m
  169.  
  170.                will load or reconfigure DgAnsi to display bright
  171.                yellow on black.  This overcomes the command.com
  172.                limitation of not allowing the entry of the Escape
  173.                character from this command line.  If you are
  174.                using 4DOS, this is equivalent to entering
  175.  
  176.                     echo e[0;1;33;40m
  177.  
  178.                from the command line.
  179.  
  180.      /T        Tests whether DgAnsi is installed.  In addition to
  181.                displaying this information on the screen, DgAnsi
  182.                returns the following errorlevels:
  183.  
  184.                     0    DgAnsi is loaded; will not install.
  185.                     1    DgAnsi is not loaded; safe to install.
  186.                     255  DgAnsi is not loaded in the current
  187.                          DESQview window but is loaded prior to
  188.                          DESQview.
  189.  
  190.      /U        Uninstall DgAnsi.  If DgAnsi is not the last
  191.                loaded memory-resident program ("TSR") it cannot
  192.                be uninstalled; instead, it will be turned off but
  193.                will remain in memory.
  194.  
  195.      /W        Create a secondary resident copy.  This switch is
  196.                positional and should be specified before any of
  197.                the above options.  Its purpose is to allow the
  198.                creation of a "shell copy" in any environment.
  199.                This can be useful if you wish to create a
  200.                specially defined set of ANSI sequences for a
  201.                limited purpose, and then return easily and
  202.                quickly to the original configuration.
  203.  
  204.                Creating a secondary copy of DgAnsi turns the
  205.                parent copy off.  Uninstalling the shell copy does
  206.                not automatically turn the parent copy back on; it
  207.                must be specifically reenabled by DgAnsi ON.
  208.  
  209.   Note: DgAnsi directly supplies the KSTACK.COM functions for
  210.   the KEYSTACK command in 4DOS version 4.0. It is therefore not
  211.   nessecary (and will waste memory) to load both KSTACK.COM and DGANSI.COM.
  212.  
  213.  
  214. IV.  DgAnsi.Shp
  215.  
  216.      DgAnsi.Shp is a "Shared Program" for DESQview.  It can be
  217. used in place of loading DgAnsi.Com a second time in a DESQview
  218. window.
  219.  
  220.      There are three advantages to using DgAnsi.Shp with
  221. DESQview.  First, it loads faster.  Second, DgAnsi and a program
  222. can be started together directly from DESQview, instead of via a
  223. batch file which first loads DgAnsi and then loads the
  224. application.  This avoids the overhead of loading another
  225. instance of the command processor and occupies less memory.
  226.  
  227.      Third, DgAnsi.Shp works by utilizing the code of DgAnsi.Com,
  228. while maintaining its own data space in the DESQview window.
  229. This means that each DESQview window can set DgAnsi's buffer size
  230. independently of the DgAnsi.Com's initial buffer size, or of the
  231. buffer size in any other DESQview window.
  232.  
  233.      DgAnsi.Com must be loaded before starting DESQview if you
  234. plan to use DgAnsi.Shp.  If DgAnsi has not been installed,
  235. DESQview will refuse to open any window in which DgAnsi.Shp is
  236. specified and an error message will advise you that DgAnsi.Com
  237. must be loaded.
  238.  
  239.      Valid commands and switches for DgAnsi.Shp are the same as
  240. for DgAnsi.Com.
  241.  
  242.      Upon shelling out of the program or upon reaching the DOS
  243. prompt in the DESQview window, DgAnsi.Com can be used to change
  244. the default settings in the same manner as outside DESQview.
  245.  
  246.      To specify DgAnsi.Shp in a DESQview window, open the "Change
  247. a Program" window.  In the "Advanced Options" screen (F1 from the
  248. opening "Change a Program" screen), specify at least 2 kilobyte
  249. in the "System Memory" field.
  250.  
  251.      Use the tab key to advance to the "Shared Program" section
  252. of the screen.  In the "Pathname" field, specify the full name of
  253. DgAnsi.Shp, including the path.  Commands and switches may be
  254. entered in the "Data" field.
  255.  
  256.      Two kilobyte of system memory is adequate for the DgAnsi.Com
  257. default configuration.  If you install DgAnsi with a larger
  258. keyboard reassignment buffer, you may need to specify more system
  259. memory.  Excessively large "System Memory" values will produce
  260. unpredictable results.
  261.  
  262.  
  263. V.   Compatibility
  264.  
  265.      DgAnsi has been tested on a wide variety of computers, under
  266. many configurations.  It should be compatible with any IBM
  267. compatible running DOS 3.1 or above.
  268.  
  269.      DgAnsi hooks Interrupts 16h, 21h, 29h, and 2Fh.  You may
  270. experience conflicts if other TSRs loaded on your computer hook
  271. any of these interrupts.
  272.  
  273.       In particular, many keyboard enhancers also hook Int 16h.
  274. In most cases this and other conflicts can be resolved simply by
  275. assuring that DgAnsi is loaded after the conflicting program.
  276.  
  277.      4DOS, the replacement command processor, includes a KEYSTACK
  278. command for feeding keystrokes to other applications.  Its use
  279. requires that KSTACK.COM, a TSR which is part of the 4DOS
  280. distribution package, be loaded in order to enable the KEYSTACK
  281. command.  KSTACK.COM also hooks Interrupt 16h.
  282.  
  283.      DgAnsi.Com has been extensively tested with 4DOS Version
  284. 4.0, and we have found no incompatibilities.  Some systems
  285. require that DgAnsi.Com be loaded after KSTACK.COM in order for
  286. the key redefinitions to work properly.
  287.  
  288.  
  289. VI.  DgAnsi Command Sequences
  290.  
  291.      DgAnsi includes a number of command sequences which are
  292. neither part of the ANSI X3.64-1979 specification nor of the IBM
  293. ANSI implementation.  In the command listing which follows the
  294. ANSI X3.64-1979 mnemonic, if it exists, is provided in
  295. parentheses (e.g., CUP).
  296.  
  297. Cursor Functions
  298.  
  299.   Esc[l;cH  Cursor Position                            (CUP)
  300.   Esc[l;cV  Horizontal and Vertical Position           (HVP)
  301.             HVP and CUP move the cursor to the position
  302.             specified. The first parameter (l) specifies the line
  303.             number; the second (c) specifies the column number.
  304.             When no parameters are specified the cursor moves to
  305.             the home position (the upper left-hand corner of the
  306.             screen).
  307.  
  308.   Esc[nA    Cursor Up                                  (CUU)
  309.             This sequence moves the cursor up without changing
  310.             columns. The value of n sets the number of lines
  311.             moved.  When no parameter is specified the cursor
  312.             moves up one line.  It the cursor is already on the
  313.             top line, the CUU sequence is ignored.
  314.  
  315.   Esc[nB    Cursor Down                                (CUD)
  316.             This sequence moves the cursor down without changing
  317.             columns.  The value of n sets the number of lines
  318.             moved.  When no parameter is specified the cursor
  319.             moves down one line.  It the cursor is already on the
  320.             bottom line, the CUD sequence is ignored.
  321.  
  322.   Esc[nC    Cursor Forward                             (CUF)
  323.             This sequence moves the cursor forward without
  324.             changing lines.  The value of n sets the number of
  325.             columns moved.  When no parameter is specified the
  326.             cursor moves forward one column.  It the cursor is
  327.             already on the far right column, the CUF sequence is
  328.             ignored.
  329.  
  330.   Esc[nD    Cursor Backward                            (CUB)
  331.             This sequence moves the cursor backward without
  332.             changing lines.  The value of n sets the number of
  333.             columns moved.  When no parameter is specified the
  334.             cursor moves backward one column.  It the cursor is
  335.             already on the far left column, the CUB sequence is
  336.             ignored.
  337.  
  338.   Esc[6n    Device Status Report                       (DSR)
  339.             The console driver outputs a Cursor Position Report
  340.             sequence when it receives a DSR sequence.
  341.             ANSI X3.64-1979 defines this sequence as containing
  342.             any decimal number in the range 0 to 9, or a
  343.             semi-colon (ASCII code 48 to 57, or 59 decimal); most
  344.             versions of DOS specify the integer 6.  Using DgAnsi,
  345.             any number in the range 1 to 254 will return a Cursor
  346.             Position Report.
  347.  
  348.   Esc[255n  Device Status Report (maximum)
  349.             Parameter 255 in a DSR sequence reports the maximum
  350.             screen size, in line and columns, of the current
  351.             screen mode.  The output is in the same format as the
  352.             Cursor Position Report, except that maximum values
  353.             instead of current values are reported.
  354.  
  355.   Esc[s     Save Cursor Position                       (SCP)
  356.             The console driver saves the current cursor position.
  357.             This position can be restored by the Restore Cursor
  358.             Position sequence.
  359.  
  360.   Esc[u     Restore Cursor Position                    (RCP)
  361.             This sequence restores the cursor position to the
  362.             value it had when the console driver received the
  363.             Save Cursor Position sequence.  If no SCP sequence
  364.             was received, RCP is ignored.
  365.  
  366.   Esc[l;cR  Cursor Position Report                     (CPR)
  367.             The console driver outputs a CPR sequence when it
  368.             receives a Device Status Report sequence.
  369.  
  370. Erase Functions
  371.  
  372.   Esc[2J    Erase Display                              (ED)
  373.             This sequence erases the entire screen and returns
  374.             the cursor to the home position.
  375.  
  376.   Esc[K     Erase Line                                 (EL)
  377.             This sequence erases everything from the current
  378.             cursor position to the end of the line, including the
  379.             current cursor position.
  380.  
  381.   Esc[0J    Erase Display from Cursor Forward
  382.             This sequence erases everything from the current
  383.             cursor position to the bottom of screen, including
  384.             the current cursor position.  The cursor position is
  385.             not updated.
  386.  
  387.   Esc[1J    Erase Display from Cursor Backward
  388.             This sequence erases everything from the current
  389.             cursor position to the top of screen, including the
  390.             current cursor position.  The cursor position is not
  391.             updated.
  392.  
  393.   Esc[]     Erase next Carriage Return and Line Feed
  394.             This sequence erases the next carriage return / line
  395.             feed pair without repositioning the cursor.  This
  396.             makes it possible to issue an ECHO without generating
  397.             a carriage return / line feed.
  398.  
  399. Modes of Operation
  400.  
  401.   Esc[sm    Set Graphics Rendition                     (SGR)
  402.             This sequence invokes graphic rendition specified by
  403.             the parameters in the following list.  These
  404.             functions are cumulative and remain in effect until
  405.             the next SGR sequence; multiple parameters are
  406.             delimited by semi-colons.
  407.  
  408.             Graphics Functions
  409.  
  410.               0  All attributes off (normal, white on black)
  411.               1  Bold on (high intensity)
  412.               4  Underscore On (monochrome displays only)
  413.               5  Blink on
  414.               7  Reverse Video on
  415.               8  Concealed on  (invisible)
  416.               30 Black foreground
  417.               31 Red foreground
  418.               32 Green foreground
  419.               33 Yellow foreground
  420.               34 Blue foreground
  421.               35 Magenta foreground
  422.               36 Cyan foreground
  423.               37 White foreground
  424.               40 Black background
  425.               41 Red background
  426.               42 Green background
  427.               43 Yellow background
  428.               44 Blue background
  429.               45 Magenta background
  430.               46 Cyan background
  431.               47 White background
  432.  
  433.   Esc[sh    Select Mode                                (SM)
  434.             This sequence selects the screen width or type
  435.             specified.
  436.  
  437.             Graphics Modes
  438.  
  439.               0  40 x 25 monochrome text
  440.               1  40 x 25 color text
  441.               2  80 x 25 monochrome text
  442.               3  80 x 25 color text
  443.               4  320 x 200 graphics 4-color
  444.               5  320 x 200 graphics 2-color
  445.               6  640 x 200 graphics 2-color
  446.               7  wrap at end of line (word wrap)
  447.  
  448.             The following parameters were added to the IBM subset
  449.             with DOS 4.0.  DgAnsi supports them with earlier
  450.             versions of DOS, but they are hardware dependent:
  451.  
  452.               13 320 x 200 graphics 16-color
  453.               14 640 x 200 graphics 16-color
  454.               15 640 x 350 graphics 2-color
  455.               16 640 x 350 graphics 16-color
  456.               17 640 x 480 graphics 2-color
  457.               18 640 x 480 graphics 16-color
  458.               19 320 x 200 graphics 256-color
  459.  
  460.             All numbers except 7 are passed to the BIOS, Int 10h.
  461.             Depending on your hardware and other software,
  462.             specifying higher numbers may produce interesting
  463.             results.  For this reason, DgAnsi makes no attempt to
  464.             trap invalid numbers; if your hardware does not trap
  465.             unsupported Int 10h functions, proceed at your own
  466.             risk.
  467.  
  468.  
  469.   Esc[sl    Reset Mode                                 (RM)
  470.             This sequence resets the screen width or type
  471.             specified; the parameters are the same as for SM.
  472.             Setting mode 7 with an "h" command (SM) tells DgAnsi
  473.             to wrap text to the next line when it passes the end
  474.             of a line; setting mode 7 with an "l" (RM) command
  475.             tells ANSI not to wrap text; the line is truncated.
  476.             For all other modes the SM and RM commands are
  477.             equivalent.
  478.  
  479. IBM PC Keyboard Reassignment
  480.  
  481.      Keyboard reassignment uses an undefined ANSI X3.64-1979 code
  482. sequence to define a character or set of characters sent by the
  483. console whenever a given key is pressed on an IBM PC compatible.
  484. The sequence is:
  485.  
  486.      Esc[#;#p
  487.      or Esc["string";"string"p
  488.      or Esc[#;"string"p
  489.      or Esc["string";#p
  490.  
  491.      The first # is the ASCII character code for the key to be
  492. reassigned.  It is followed by a single key code or string of
  493. codes that are to replace it.  If the first parameter is 0 or
  494. 224, then the first and second parameters make up an extended
  495. ASCII code and the third parameter becomes the reassignment
  496. character.
  497.  
  498.      Enclosing a string in single or double quotes permits the
  499. entry of standard keys.  For example:
  500.  
  501.      Esc[0;32;"dir"13p
  502.  
  503. assigns the key Alt-D (0;32) to the string "dir" followed by a
  504. carriage return (13).
  505.  
  506.      For a complete listing of ASCII key codes, see the Appendix.
  507.  
  508. To control keyboard reassignments using DgAnsi sequences:
  509.  
  510.      Esc[=1P     Turn Keyboard Reassignments On
  511.                  Any digit other than 1 will turn keyboard
  512.                  reassignments off.
  513.  
  514.      Esc[?1P     Enable Keyboard Reassignments
  515.                  Any digit other than 1 will disable keyboard
  516.                  reassignments.
  517.  
  518.      Esc[=1q     Enable Extended Keyboard support
  519.                  Any digit other than 1 will disable extended
  520.                  keyboard support.
  521.  
  522.  
  523. VII. License and Disclaimer
  524.      DgAnsi.Com
  525. Copyright By:
  526.     Don E. Groves, Jr.
  527.     2915 West Ox Rd.
  528.     Herndon, VA 22071
  529.  
  530.     CIS Number [71310,3702]
  531.  
  532.      DgAnsi and all files contained in this distribution archive
  533. are copyright 1990-1992 by Don E. Groves, Jr.  Support is
  534. available from the author via CompuServe Information Service
  535. [71310,3702].
  536.  
  537.     If you find DgAnsi useful, your gift of $15,  or any amount,
  538. would be greatly appreciated.
  539.  
  540.      You may distribute copies of DgAnsi to friends, computer
  541. clubs or users' groups, and to computer bulletin boards, so long
  542. as (1) no fee is charged (other than a nominal media fee), and
  543. (2) all files are included without modification.  You may not
  544. sell or charge any fee for providing DgAnsi other than a nominal
  545. media fee not exceeding $5.00, or $10.00 if other programs are
  546. supplied on the same distribution diskette.
  547.  
  548.      The author has taken extensive precautions to use standard,
  549. documented programming calls and DOS functions, and to test the
  550. software with a wide variety of hardware and software
  551. combinations.  If you discover any bugs in the program, please
  552. notify the author via CompuServe Mail.
  553.  
  554.      If you feel that bugs in the program have caused you any
  555. damages, I'll sympathize with you and attempt to correct any
  556. programming errors.  It won't do you any good to sue me, though,
  557. because I'm just a struggling computer programmer and consultant
  558. who doesn't have enough money to make it worth your time and
  559. legal costs.
  560.  
  561.      The lawyers tell me I'm supposed to say it this way:
  562.  
  563. THIS PROGRAM IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY
  564. KIND.
  565.  
  566. THE AUTHOR DISCLAIMS ANY AND ALL OTHER WARRANTIES, EXPRESS OR
  567. IMPLIED, ORAL OR WRITTEN, INCLUDING ANY IMPLIED WARRANTIES OF
  568. MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
  569.  
  570. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY INCIDENTAL,
  571. CONSEQUENTIAL, OR PUNITIVE DAMAGES WHATSOEVER ARISING OUT OF USE
  572. OF THE PROGRAM OR YOUR RELATIONSHIP WITH THE AUTHOR, INCLUDING
  573. WITHOUT LIMITATION ANY OR ALL DAMAGES FOR LOSS OF PROFITS,
  574. BUSINESS INTERRUPTION, LOSS OF INFORMATION OR ANY PECUNIARY LOSS,
  575. EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
  576. DAMAGES.
  577.  
  578.  
  579. Appendix - ASCII Key Codes
  580.  
  581. Standard Keys (All keyboards).  Codes included in parentheses
  582. require DOS 4.0 or above.
  583.  
  584. Key                 Code       Shift      Ctrl       Alt
  585.  
  586. A                     97         65         1        0;30
  587. B                     98         66         2        0;48
  588. C                     99         67         3        0;46
  589. D                     100        68         4        0;32
  590. E                     101        69         5        0;18
  591. F                     102        70         6        0;33
  592. G                     103        71         7        0;34
  593. H                     104        72         8        0;35
  594. I                     105        73         9        0;23
  595. J                     106        74         10       0;36
  596. K                     107        75         11       0;37
  597. L                     108        76         12       0;38
  598. M                     109        77         13       0;50
  599. N                     110        78         14       0;49
  600. O                     111        79         15       0;24
  601. P                     112        80         16       0;25
  602. Q                     113        81         17       0;16
  603. R                     114        82         18       0;19
  604. S                     115        83         19       0;31
  605. T                     116        84         20       0;20
  606. U                     117        85         21       0;22
  607. V                     118        86         22       0;47
  608. W                     119        87         23       0;17
  609. X                     120        88         24       0;45
  610. Y                     121        89         25       0;21
  611. Z                     122        90         26       0;44
  612. 1                     49         33         --       0;120
  613. 2                     50         64         0        0;121
  614. 3                     51         35         --       0;122
  615. 4                     52         36         --       0;123
  616. 5                     53         37         --       0;124
  617. 6                     54         94         30       0;125
  618. 7                     55         38         --       0;126
  619. 8                     56         42         --       0;127
  620. 9                     57         40         --       0;128
  621. 0                     48         41         --       0;129
  622. -                     45         95         --       0;130
  623. =                     61         43         31       0;131
  624. [                     91         123        27       0;26
  625. ]                     93         125        29       0;27
  626. \                     92         124        28       0;43
  627. :                     59         58         --       0;39
  628. '                     39         34         --       0;40
  629. ,                     44         60         --       0;51
  630. .                     46         62         --       0;52
  631. /                     47         63         --       0;53
  632. `                     96         126        --      (0;41)
  633.  
  634. Enter (keypad)        13         --         10      (0;166)
  635. / (keypad)            47         47      (0;142)    (0;74)
  636. * (keypad)            42      (0;144)    (0;78)       --
  637. - (keypad)            45         45      (0;149)    (0;164)
  638. + (keypad)            43         43      (0;150)    (0;55)
  639. 5 (keypad)         (0;76)        53      (0;143)      --
  640.  
  641.  F1                 0;59       0;84       0;94       0;104
  642.  F2                 0;60       0;85       0;95       0;105
  643.  F3                 0;61       0;86       0;96       0;106
  644.  F4                 0;62       0;87       0;97       0;107
  645.  F5                 0;63       0;88       0;98       0;108
  646.  F6                 0;64       0;89       0;99       0;109
  647.  F7                 0;65       0;90       0;100      0;110
  648.  F8                 0;66       0;91       0;101      0;111
  649.  F9                 0;67       0;92       0;102      0;112
  650. F10                 0;68       0;93       0;103      0;113
  651. F11                 0;133      0;135      0;137      0;139
  652. F12                 0;134      0;136      0;138      0;140
  653.  
  654. Home                0;71         55       0;119       --
  655. Up                  0;72         56      (0;141)      --
  656. PgUp                0;73         57       0;132       --
  657. Left                0;75         52       0;115       --
  658. Right               0;77         54       0;116       --
  659. End                 0;79         49       0;117       --
  660. Down                0;80         50      (0;145)      --
  661. PgDn                0;81         51       0;118       --
  662. Ins                 0;82         48      (0;146)      --
  663. Del                 0;83         46      (0;147)      --
  664.  
  665. Extended Keys (Enhanced keyboards only).
  666.  
  667. Home (gray key)  (224;71)   (224;71)   (224;119)  (224;151)
  668. Up (gray key)    (224;72)   (224;72)   (224;141)  (224;152)
  669. PgUp (gray key)  (224;73)   (224;73)   (224;132)  (224;153)
  670. Left (gray key)  (224;75)   (224;75)   (224;115)  (224;155)
  671. Right (gray key) (224;77)   (224;77)   (224;116)  (224;157)
  672. End (gray key)   (224;79)   (224;79)   (224;117)  (224;159)
  673. Down (gray key)  (224;80)   (224;80)   (224;145)  (224;154)
  674. PgDn (gray key)  (224;81)   (224;81)   (224;118)  (224;161)
  675. Ins (gray key)   (224;82)   (224;82)   (224;146)  (224;162)
  676. Del (gray key)   (224;83)   (224;83)   (224;147)  (224;163)
  677. PrScr (gray key)     --         --        0;114       --
  678. Pause (gray key)     --         --        0;0         --
  679. Bksp (gray key)       8          8          127       (0)
  680. Enter (gray key)      13        --          10        --
  681. Tab (gray key)        9        0;15      (0;148)    (0;165)
  682. Null (gray key)     0;3         --         --         --
  683.  
  684.